package com.example.demo.mqclient;

import lombok.Data;

import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 张
 * Date: 2024-08-24
 * Time: 3:02
 */
//连接工厂
@Data
public class ConnectionFactory {
    //BrokerServer的ip地址
    private String host;
    //brokerServer的端口号
    private int port;
    //访问BrokerServer哪个虚拟主机(目前就一个) -- 扩展
//    private String VirtualHostName;
//    private String userName;
//    private String password;

    //创建连接对象
    public Connection newConnection() throws IOException {
        Connection connection = new Connection(host,port);
        return connection;
    }
}
